<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean" prefix="bean"%>
<%@ taglib uri="/WEB-INF/tld/struts-html" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic" prefix="logic"%>
<%@ taglib uri="/WEB-INF/tld/jstl/c" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html:html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="keywords" content="ebb365,ebb365,ebb365">
	<meta http-equiv="description" content="ebb365">
	<title>个人会员信息编辑</title>
	<link rel="stylesheet" type="text/css" href="/admin/css/css.css"></link>
	<style type="text/css">
font{font-size: 14px;color:red}
</style>

	<script type='text/javascript'
		src='/dwr/interface/CountryAreaSelect.js'></script>
	<script type='text/javascript' src='/dwr/engine.js'></script>
	<script type='text/javascript' src='/dwr/util.js'></script>
	<script type='text/javascript' src='/js/birthday.js'></script>
	<script type="text/javascript">
		function getAllProv() {
		    CountryAreaSelect.getAllProvinces(provSelectOptions);
		 }
 
		 function getCiytByProvId(provID){
		    CountryAreaSelect.getAllCitiesByProvinceId(provID,citySelectOptions);
		 }
		 
		 function getDiquByCityId(cityID){
		    CountryAreaSelect.getAllDiquesByCityId(cityID,diquSelectOptions);
		 }
		 
		 function provSelectOptions(provList){
		     DWRUtil.removeAllOptions("provid");
		     DWRUtil.addOptions("provid", provList);   
		 }
		 
		 function citySelectOptions(cityList){
		      DWRUtil.removeAllOptions("cityid");
		      DWRUtil.removeAllOptions("diquid"); 
		      DWRUtil.addOptions("cityid", cityList); 
		 }
		 
		  function diquSelectOptions(diquList){
		      DWRUtil.removeAllOptions("diquid");
		      DWRUtil.addOptions("diquid", diquList); 
		 }
		 
		 function getProvSelected(selectObj){
		       for(var i = 0; i < selectObj.options.length; i++){
			       if (selectObj.options[i].selected){
			         var id = selectObj.options[i].value;
			          getCiytByProvId(id);
			       }
			   }
		 }
 
		 function getCitySelected(selectObj){
		       for(var i = 0; i < selectObj.options.length; i++){
			       if (selectObj.options[i].selected){
			         var id = selectObj.options[i].value;
			          getDiquByCityId(id);
			       }
		       }
		  }
		 function checkForm(){
		  	var sex = document.forms[0].sex;
		  	for(i=0;i<document.forms[0].sex.length;i++)   
			if(sex[i].checked)   
			  {
			  	return true;
			  }   
			  
			alert("请选择性别!");
		  	return false;
		  }
		  
</script>

</head>
<body>
	<br />
	<br />
	<logic:present name="detail" scope="request">
		<c:set var="linkStr" value="&bk_GYonghum=${bk_GYonghum}
		&bk_turename=${bk_turename}&bk_ifdel=${bk_ifdel}&page=${page}"></c:set>
		<html:form action="/admin/member/member_list.do?method=EditMember${linkStr}"
			onsubmit="return checkForm();">
			<html:hidden property="GUserid" value="${detail.GUserid }" />
			<table align="center" width="70%">
				<tr>
					<td>
						会员ID:
					</td>
					<td>
						<html:hidden property="GUserid" value="${detail.GUserid }" />
						${detail.GUserid }
					</td>
				</tr>
				<tr>
					<td>
						用户名:
					</td>
					<td>
						<html:hidden property="GYonghum" value="${detail.GYonghum }" />
						${detail.GYonghum }
					</td>
				</tr>
				<tr>
					<td>
						真实姓名:
					</td>
					<td>
						<html:text property="turename" value="${detail.turename }"></html:text>
					</td>
				</tr>
				<tr>
					<td>
						性 别:
					</td>
					<td>
						<input type="radio" name="sex" value="1"
							<c:if test="${detail.sex == null || detail.sex==1}">checked</c:if>>男</input>
						<input type="radio" name="sex" value="0"
							<c:if test="${detail.sex==0}">checked</c:if>>女</input>
					</td>
				</tr>


				<tr>
					<td>
						出生日期:
					</td>
					<td>
						<html:text property="bornstr" value="${detail.born }"
							onfocus="setday(this);" />
					</td>
				</tr>
				<tr>
					<td>
						证件号码:
					</td>
					<td>
						<html:select property="zjtype" size="1" value="${detail.zjtype }">
							<html:option value="身份证">身份证</html:option>
							<html:option value="军官证">军官证</html:option>
							<html:option value="护照">护照</html:option>
							<html:option value="其他">其他</html:option>
							<%--<option value="身份证" <c:if test="${detail.zjtype=='身份证'}">selected</c:if>>身份证</option>
							<option value="军官证" <c:if test="${detail.zjtype=='军官证'}">selected</c:if>>军官证</option>
							<option value="护照" <c:if test="${detail.zjtype=='护照'}">selected</c:if>>护照</option>
							<option value="其他" <c:if test="${detail.zjtype=='其他'}">selected</c:if>>其他</option>--%>
						</html:select>
						<html:text property="zjhaoma" value="${detail.zjhaoma }"></html:text>
					</td>
				</tr>
				<tr>
					<td>
						联系电话:
					</td>
					<td>
						<html:text property="zzTel" value="${detail.zzTel }"></html:text>
					</td>
				</tr>
				<tr>
					<td>
						手机:
					</td>
					<td>
						<html:text property="mobile" value="${detail.mobile }"></html:text>
					</td>
				</tr>
				<tr>
					<td>
						电子邮件:
					</td>
					<td>
						<html:text property="mail" value="${detail.mail }"></html:text>
					</td>
				</tr>
				<tr>
					<td>
						详细地址:
					</td>
					<td>
						<html:text property="TAddress" value="${detail.TAddress }"></html:text>
					</td>
				</tr>
				<tr>
					<td>
						邮政编码:
					</td>
					<td>
						<html:text property="code" value="${detail.code }"></html:text>
					</td>
				</tr>

				<tr>
					<td>
						省、市、县：
					</td>
					<td>

						<html:select property="provid" onchange="getProvSelected(this);">
							<logic:present name="provList">
								<logic:iterate id="list" name="provList">
									<option value="${list.provId}" <c:if test="${list.provId == detail.prov.provId}">selected</c:if>>${list.prov}</option>
								</logic:iterate>
							</logic:present>							
						</html:select>

						<html:select property="cityid" onchange="getCitySelected(this);">
							<logic:present name="cityList">
								<logic:iterate id="list" name="cityList">
									<option value="${list.cityId}" <c:if test="${list.cityId == detail.city.cityId}">selected</c:if>>${list.city}</option>
								</logic:iterate>
							</logic:present>
						</html:select>

						<html:select property="diquid">
							<logic:present name="diquList">
								<logic:iterate id="list" name="diquList">
									<option value="${list.diquId}" <c:if test="${list.diquId == detail.diqu.diquId}">selected</c:if>>${list.diquming}</option>
								</logic:iterate>
							</logic:present>
						</html:select>
					</td>
				</tr>
				<tr>
					<td>
						<html:submit value="更 改" />
					</td>
					<td>
						<html:cancel value="取 消" />
					</td>
				</tr>
			</table>

		</html:form>

	</logic:present>
	<logic:notPresent name="detail" scope="request">
		sorry ! it's not present.
	</logic:notPresent>
	
</body>
</html:html>
